<?php use_helper('Javascript') ?>
<?php echo checkbox_tag('calendar[is_personal]'
                        , 1
                        , $calendar->getIsPersonal()
                        , array('class' => ''))?>
<div id="ConfrimPopupDiv">...</div>
<script type="text/javascript">
function confirmation(value)
{
    jQuery.ajax({
        type: "post"
        , data: ({'id': jQuery('#id').val(), 'all': jQuery('calendarrepeat').val(), 'update': value })
        , dataType: "html"
        , async: false
        , url: "/public_html/test.php/calendar/saveinfo"
        , success: function(data) {
            jQuery('#ConfrimPopupDiv').html(data);
          }
        , error: function() { console.debug("error"); }
    });
    var answer = confirm('Are you sure?');
    if (answer)
    {
        if(value!="update_all")
        {
            jQuery('#$sf_admin_edit_form').submit();
        }else
        {
            jQuery('#$sf_admin_edit_form').post('/public_html/test.php/calendar/save'
                                            , {'update_all':value}
                                            , function(){location.href = "/public_html/test.php/calendar/list";});
        }
    }else
    {
        jQuery('#saveInfo').hide();
    }
}
</script>
